#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;

  for (int x = 100; x > 0; x--) {
    for (int k = 1; k <= 200; k++) {
      if (52 * (7 * x + 21 * k) == n) {
        cout << x << endl << k;
        return 0; // 不能break;
      }
    }
  }
  return 0;
}